package com.cy.pj.module.Exception;

import com.cy.pj.module.pojo.ResponseResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class doException {
    private static final Logger logger=LoggerFactory.getLogger(doException.class);

    @ExceptionHandler(ArithmeticException.class)
    public ResponseResult ResponseResult(ArithmeticException e){
        e.printStackTrace();
        logger.info("exception:",e.getMessage());
        return new ResponseResult(e);
    }
}
